package oktx.sample.dubbo;

import oktx.sample.dubbo.model.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by dave on 18-5-20 上午10:44.
 */
@Mapper
public interface BookMapper {
    @Insert("insert into book(name, content, num, shop_id) value (#{name}, #{content}, #{num}, #{shopId})")
    @Options(useGeneratedKeys = true)
    int insert(Book book);

    @Select("select * from book")
    List<Book> getList();

    @Update("truncate table book")
    int clear();
}
